package com.dq.Week3.day12;

import javafx.print.Collation;
import org.omg.PortableInterceptor.INACTIVE;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;

public class IteratorDemo {
    public static void main(String[] args) {
        Collection<Integer> c = new ArrayList<>();
        c.add(10);
        c.add(12);
        c.add(3);

        Iterator<Integer> iterator  = c.iterator();
        while (iterator.hasNext())
        {
            System.out.println(iterator.next());
        }
    }
}
